package com.nio.basic;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import com.io.basic.FileReaderWorker;
import com.io.basic.FileWriterWorker;

public class TestChannel {
	
	public static void main(String[] args) throws FileNotFoundException {
		
		FileInputStream fileInputStream =  new FileInputStream(new File("src/sample.txt"));
		FileOutputStream fileOS = new FileOutputStream(new File("src/sample.txt"));
		
		Thread t1 = new Thread(new FileWriterWorker(fileOS));
		Thread t2 = new Thread(new FileReaderWorker(fileInputStream));
		Thread t3 = new Thread(new FileWriterWorker(fileOS,"Priyanka"));
		
		t1.start();
		t3.start();
		t2.start();
		
		
		
		
	}

}
